﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Campus
{
    public abstract class Ability {
        
        private AbilityMenuIcon m_menuIcon;
        public AbilityMenuIcon MenuIcon {
          get { return m_menuIcon; }
        }
        
        private BaseEntity m_owner;
        public BaseEntity Owner {
            get { return m_owner; }
        }
        
        private Animation m_animation;
        public Animation AbilityAnimation {
          get { return m_animation; }
        }

        private bool m_isAbilityDone;
        public bool IsAbilityDone {
            get { return m_isAbilityDone; }
            protected set { m_isAbilityDone = value; }
        }

        public ButtonDelegate MenuDelegate { get; protected set; }

        public enum TargetTypes {
            PointTarget,
            BaseEntityTarget,
            Unit,
            None
        };

        private TargetTypes m_targetType;
        public TargetTypes TargetType {
            get { return m_targetType; }
        }

        public Ability(AbilityMenuIcon menuIcon, BaseEntity owner, Animation animation,
                TargetTypes targetType) {
            m_menuIcon = menuIcon;
            m_owner = owner;
            m_animation = animation;
            m_targetType = targetType;
            m_isAbilityDone = false;
        }
        //copy ctor
        public Ability(Ability copySource) {
            m_menuIcon = copySource.m_menuIcon;
            m_animation = copySource.m_animation;
            m_owner = copySource.m_owner;
            m_targetType = copySource.m_targetType;
            m_target = copySource.m_target;
            m_isAbilityDone = copySource.m_isAbilityDone;
        }

        private Object m_target;
        public Object Target {
            set { m_target = value; }
            get { return m_target; }
        }

        abstract public Ability Clone();
        abstract public void Update(GameTime gameTime, bool checkInput, bool updateBoundingBox);
    }
}
